<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>考试通过列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/iconfont.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css" media="all">

    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../js/base.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        tr td,
        tr th {
            text-align: center !important;
            border: none !important;
        }

        .layui-laydate-content tr td {
            border-bottom: none !important;
            border-top: none !important;
        }

        tr td {
            border-bottom: 1px solid #eee !important;
            border-top: 1px solid #eee !important;
        }
    </style>
</head>

<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card" style="display: flex;justify-content: space-between;">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote" style="border:0;font-size: 18px;color: #000;">考试通过列表
                    </blockquote>
                </div>
                <div class="layui-card-body " style="display: flex;">
                    <!--                    <blockquote style="cursor: pointer" class="layui-elem-quote"-->
                    <!--                                onclick="xadmin.open('新增广告','add_advertisement.html',600,500)"><i-->
                    <!--                            class="layui-icon">&#xe654;</i>新增广告-->
                    <!--                    </blockquote>-->

                </div>
            </div>
        </div>
        <div class="layui-card-body layui-table-body layui-table-main">

            <!-- 表格部分开始 -->
            <table id="fieldExamination_table" lay-filter="test" lay-data="{id: 'testReload'}"></table>

            <!-- 表格结束 -->
        </div>
    </div>
</div>
</div>
</body>

</html>

<script>
    layui.use('table', function () {
        var table = layui.table;
        var form = layui.form;

        var index = layer.load(1); //添加laoding,0-2两种方式

        //第一个实例
        var ins1 = table.render({
            elem: '#fieldExamination_table', //指定原始表格元素选择器（推荐id选择器）
            // height: 600,
            width: "100%",
            // 附加参数，post token
            // where: { 'token': token },
            loading: true,
            method: 'post',
            url: getExaminationAdoptList, //数据接口
            page: true, //开启分页
            // toolbar: 'default', //开启工具栏，此处显示默认图标
            cols: [
                [ //表头
                    // { type: 'checkbox', fixed: 'left' },
                    {
                        field: 'id',
                        title: 'ID',
                        width: 150
                    },
                    {
                        field: 'name',
                        title: '姓名',
                        width: 150
                    },
                    {
                        field: 'documentNumber',
                        title: '证件号码',
                        width: 150
                    },
                    {
                        field: 'level',
                        title: '申请等级',
                        width: 150,
                        templet: function (d) {
                            if (d.level == "1") {
                                return "一级";
                            } else if (d.level == "2") {
                                return "二级";
                            } else if (d.level == "3") {
                                return "三级";
                            } else if (d.level == "4") {
                                return "四级";
                            } else if (d.level == "5") {
                                return "五级";
                            } else if (d.level == "6") {
                                return "六级";
                            } else if (d.level == "7") {
                                return "七级";
                            } else if (d.level == "8") {
                                return "八级";
                            } else if (d.level == "9") {
                                return "九级";
                            } else if (d.level == "10") {
                                return "十级";
                            } else {
                                return "-";
                            }
                        }
                    },
                    {
                        field: 'tel',
                        title: '手机号',
                        width: 150
                    },
                    {
                        field: 'isAdopt',
                        title: '线下场地考试是否通过',
                        width: 150,
                        templet: function (d) {
                            if (d.isAdopt == "1") {
                                return "通过";
                            } else if (d.isAdopt == "2") {
                                return "未通过";
                            }
                        }
                    },
                    {
                        field: 'score',
                        title: '文化课成绩',
                        width: 150
                    },
                ]
            ],
            id: 'testReload',
            done: function (res) {
                if (res.msg == "2") {
                    parent.window.location.href = getRequestPrefix() +
                        "/footBallAdmin/login.html"
                }
                layer.close(index)
            }
        });


        //头部输入框筛选功能
        var $ = layui.$,
            active = {

                reload: function () {

                    var type = $('#type');
                    var city = $('#city');
                    var date = $('#date');
                    // 执行重载（重新加载数据表格）
                    table.reload('testReload', {
                        page: {
                            curr: 1 //重新从第 1 页开始
                        },
                        where: {
                            "type": type.val(),
                            "city": city.val(),
                            "date": date.val(),
                        }
                    }, 'data');
                }
            };


        //给查询添加点击事件
        $('.search').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
            //一定要阻止表单的默认行为（刷新）
            return false
        });

    });

    /**
     * 点击放大图片
     * @param t
     */
    function show_img(t) {
        var t = $(t).find("img");
        //页面层
        layer.open({
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['70%', '80%'], //宽高
            shadeClose: true, //开启遮罩关闭
            end: function (index, layero) {
                return false;
            },
            content: '<div style="text-align:center;width:100%;height: 100%;overflow: hidden"><img src="' +
                $(t)
                    .attr('src') +
                '" style="width:100%;height: 100%;display: block;margin: 0 auto;"/></div>'
        });
    }
</script>